<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Rezervari extends CI_Controller {

	public function __construct()
    {
        parent::__construct();
        $this->load->model('film');
        $this->load->model('loginmodel');
    	$this->load->model('rezervare');
    }

	public function rezervare($id)
	{
		$logat = $this->loginmodel->este_logat();
		$data['titlu'] = 'Star Cinema | Cautare';
		$logat = $this->loginmodel->este_logat();
		$data['logat'] = $logat;
		if($logat)
		{
			$data['nume'] = $this->session->userdata('nume');
			$data['prenume'] = $this->session->userdata('prenume');
		}

		$this->load->view('home/header', $data);

		$rez = $this->film->get_film($id);		
		$data2['locuri'] = $this->rezervare->get_rezervari_at_hour($id);
		$data2['film'] = array(
					'id' => $id,
					'poster' => $rez->poster,
					'titlu' => $rez->titlu
				);
		$this->load->view('rezervare/content', $data2);
		$this->load->view('home/footer');
	}
}

?>